<script setup>
import {plus} from "../../../apis/auth";
import {defineProps, inject} from "vue";


const props = defineProps({
  formData:Object
})

const dialogVisible=inject('dialogVisible')
const isSuccess=inject('isSuccess')

const save = () =>{
  const { roleId, authId } = props.formData; // 解构userId和roleId
  plus({ roleId, authId }).then(()=>{
    dialogVisible.value=false
    isSuccess.value=true
  })  // 将解构出的值作为对象传递给plus函数

}

</script>

<template>

  <el-dialog :title="props.title" width="500" align-center  v-model="dialogVisible">
    <el-form>
      <el-form-item label="角色ID">
        <el-input v-model="props.formData.roleId" />
      </el-form-item>
      <el-form-item label="权限ID">
        <el-input v-model="props.formData.authId"/>
      </el-form-item>
    </el-form>
    <template #footer>
      <div class="dialog-footer">
        <el-button type="primary" @click="save">
          保存
        </el-button>
      </div>
    </template>
  </el-dialog>
</template>



<style scoped>

</style>